Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-debug-log

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-debug-log

Axios interceptor of logging requests & responses by debug.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

axios-debug-log

Node.js CI Coverage Status JavaScript Style Guide

Axios interceptor of logging requests & responses by debug.

Screenshot

Install

$ npm install --save axios axios-debug-log

Node.js usage

  1. Install: add require('axios-debug-log') before any axios execution.
  2. Enable: set DEBUG=axios environment variables before start your fantastic Node.js application.

Or

Add require('axios-debug-log/enable') before any axios execution to install and enable.

Or

Run DEBUG=axios node --require axios-debug-log [entrypoint.js]

Or

Run node --require axios-debug-log/enable [entrypoint.js]

Browser usage

  1. Install: add require('axios-debug-log') before any axios execution.
  2. Enable: set localStorage.debug = "axios" before start your fantastic web application.

Or

Add require('axios-debug-log/enable') before any axios execution to install and enable.

Please read README of debug for usage details.

Configuration

// Log content type
require('axios-debug-log')({
  request: function (debug, config) {
    debug('Request with ' + config.headers['content-type'])
  },
  response: function (debug, response) {
    debug(
      'Response with ' + response.headers['content-type'],
      'from ' + response.config.url
    )
  },
  error: function (debug, error) {
    // Read https://www.npmjs.com/package/axios#handling-errors for more info
    debug('Boom', error)
  }
})

Customization

Use require('axios-debug-log').addLogger(instance, debug) to add custom debug logger to custom instance.

var github = axios.create({ baseURL: 'https://api.github.com/' })
var githubLogger = require('debug')('github')
require('axios-debug-log').addLogger(github, githubLogger)
github('/user')

Trust by

octokit SlackAPI Center for Public Integrity AppImage pytorch

And Yours...

License

MIT

Keywords

FAQs

Package last updated on 15 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc